#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QWidget>
#include<QThread>
#include<QMutex>
class mythread : public QThread
{
    Q_OBJECT


public:
   explicit mythread(QObject *parent = nullptr);
    void run();

private:
    //多个线程使用一把锁
    static QMutex mutex;
    //多个线程访问一个数据
    static int num;
};

#endif // MYTHREAD_H
